package com.shy.portal.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.shy.base.entity.BaseEntity;

/**
 * <p>
 * Title: RolePermission
 * </p>
 * <p>
 * Description:角色权限關係實体
 * </p>
 * <p>
 * Company:
 * </p>
 * 
 * @author H2013788
 */
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "portal_role_permission")
public class RolePermission extends BaseEntity {
    private static final long serialVersionUID = 1L;


    /**
     * 與角色實体外鍵關係
     */
    @ManyToOne
    private Role role;

    /**
     * 與权限實体外鍵關係
     */
    @ManyToOne
    private Permission permission;


    /**
     * 描述
     */
    @Column(name = "description")
    private String description;

    /**
     * 是否分配
     */
    @Column(name = "checked")
    private boolean checked; // 是否分配


    /**
     * @return the role
     */
    public Role getRole() {
        return role;
    }

    /**
     * @param role
     *            the role to set
     */
    public void setRole(Role role) {
        this.role = role;
    }

    /**
     * @return the permission
     */
    public Permission getPermission() {
        return permission;
    }

    /**
     * @param permission
     *            the permission to set
     */
    public void setPermission(Permission permission) {
        this.permission = permission;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description
     *            the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the checked
     */
    public boolean isChecked() {
        return checked;
    }

    /**
     * @param checked
     *            the checked to set
     */
    public void setChecked(boolean checked) {
        this.checked = checked;
    }

}
